package numericalSim;

import simulationSupport.ParamRandom;

public class PredatorModel {

	private int x;
	private int y;
	private double speed;
	private double weigth;
	private double length;
	private double index;
	private double xHeading;
	private double yHeading;
	private String name;
	//Pregenerators
	private ParamRandom headingXSim;
	private ParamRandom headingYSim;
	
	public PredatorModel(double weigth , double length,String predName)
	{
		speed = 10 + weigth/10 + length/12;
		this.weigth = weigth;
		this.length = length;
		x = (int) (Math.random()*100);
		y = (int) (Math.random()*100);
		name = predName;
	}

	public void calculateNewCoordinates()
	{
		if(Math.random()<= 0.5 || x<0 || y<0 || !(y>1000) || !(x>1000) ){
			x = x + (int)(xHeading*speed/2);
			y = y + (int)(yHeading*speed/2);
		}
		else
		{
			x = x - (int)(xHeading*speed/2);
			y = y - (int)(yHeading*speed/2);
		}
	}
	
	public void updateHeadings()
	{
		xHeading = (Math.random());
		yHeading = (Math.random());
	}
	
	public int getX() {
		return x;
	}
	public int getY() {
		return y;
	}
	public double getSpeed() {
		return speed;
	}
	public double getWeigth() {
		return weigth;
	}
	public double getLength() {
		return length;
	}
	public double getIndex() {
		return index;
	}
	public double getxHeading() {
		return xHeading;
	}
	public double getyHeading() {
		return yHeading;
	}
	public String getName() {
		return name;
	}
	
	
	
}
